class CreateUsers < ActiveRecord::Migration
  def change
    create_table :users do |t|
      t.string :name,  :null => false, :limit => 64
      t.boolean :is_master, :null => false, :default => false
      t.boolean :is_sys_admin, :null => false, :default => false
      t.integer :own_docs_count, :null => false, :default => 0
      t.integer :create_docs_count, :null => false, :default => 0
      t.integer :gender, :null => false, :default => 0
      t.string :title,   :null => false, :default => "",:limit=>64
      t.integer :creator_id, :null => false, :default => 0
      t.integer :current_member_id,  :null => false, :default => 0
      t.integer :members_count, :null => false, :default => 0
      t.string  :security_code, :limit => 32 #安全码 
      t.boolean :activated,     :null => false, :default => false
      t.datetime :activated_at
      t.boolean :enabled,    :null => false, :default => false
      t.string  :phone, :limit => 32

      t.timestamps
    end
  end
end
